package com.bgIntlgn.client.entity.buy;

import java.util.Date;

import yuhuibear.poat.annotations.action.AutoGenerateValue;
import yuhuibear.poat.annotations.relation.Field;
import yuhuibear.poat.annotations.relation.Table;
import yuhuibear.poat.object.bean.Bean;

/**
 * 采购单
 * 
 * @author yuhui
 * 
 */
@Table(name = "buys", constrain = "")
public class Buy implements Bean {

	@AutoGenerateValue(skipOnNull = true, sqlToGet = "select currval('buys_id_seq')")
	@Field(name = "id", type = "bigserial", constrain = "primary key ")
	private Long id;

	/**
	 * 下单日期
	 */
	@Field(name = "order_date", type = "date", constrain = "")
	private Date orderDate;

	@Field(name = "serial_number", type = "varchar(80)", constrain = "unique")
	private String serialNumber;

	@Field(name = "custom_id", type = "int8", constrain = " not null references customs(id)  on update cascade ")
	private Long customId;

	@Field(name = "contactor_id", type = "int8", constrain = " not null references contactors(id)  on update cascade ")
	private Long contactorId;

	/**
	 * 付款方式
	 */
	@Field(name = "payment", type = "int8", constrain = "not null references dictionarys(id)  on update cascade ")
	private Long payment;
	/**
	 * 订单总金额
	 */
	@Field(name = "sum", type = "float ", constrain = "not null default 0.0")
	private Double sum;

	/**
	 * 采购人员
	 */
	@Field(name = "purchaser", type = "int8", constrain = "not null references employees(id)  on update cascade ")
	private Long purchaser;

	/**
	 * 订单状态: 草稿， 提交给客户， 受理中, 已收货..., [DictionaryType : 采购订单状态]
	 */
	@Field(name = "states", type = "int8", constrain = "not null references dictionarys(id)  on update cascade ")
	private Long states;

	/**
	 * 采购订单备注
	 */
	@Field(name = "comment", type = "varchar(1000)", constrain = "")
	private String comment;

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getOrderDate() {
		return this.orderDate;
	}

	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}

	public String getSerialNumber() {
		return this.serialNumber;
	}

	public void setSerialNumber(String serialNumber) {
		this.serialNumber = serialNumber;
	}

	public Long getCustomId() {
		return this.customId;
	}

	public void setCustomId(Long customId) {
		this.customId = customId;
	}

	public Long getContactorId() {
		return this.contactorId;
	}

	public void setContactorId(Long contactorId) {
		this.contactorId = contactorId;
	}

	public Long getPayment() {
		return this.payment;
	}

	public void setPayment(Long payment) {
		this.payment = payment;
	}

	public Double getSum() {
		return this.sum;
	}

	public void setSum(Double sum) {
		this.sum = sum;
	}

	public Long getPurchaser() {
		return this.purchaser;
	}

	public void setPurchaser(Long purchaser) {
		this.purchaser = purchaser;
	}

	public Long getStates() {
		return this.states;
	}

	public void setStates(Long states) {
		this.states = states;
	}

	public String getComment() {
		return this.comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

}
